package com.link2room.blaster.controller.inside;

import com.link2room.blaster.dto.param.base.BlasterBaseParamDto;
import com.link2room.blaster.dto.result.SMSAuthCodeResDto;
import com.link2room.blaster.facade.ISendMsgFacadeService;
import com.link2room.common.dto.result.base.BaseResultDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * Created by LN on 2016/9/13.
 */
@Api(tags = "微信模板消息发送")
@RestController
@RequestMapping("/in/WxMsg")
public class WXTemplateMsgInsideController {
    @Resource
    private ISendMsgFacadeService sendMsgFacadeService;

    @ApiOperation(value = "微信模板消息发送", response = SMSAuthCodeResDto.class)
    @ApiImplicitParams(value = {
            @ApiImplicitParam(value = "paramDto", paramType = "body", dataTypeClass = BlasterBaseParamDto.class, required = true)
    })
    @RequestMapping(method = RequestMethod.POST)
    public BaseResultDto sendMsg(
            @RequestBody BlasterBaseParamDto paramDto
    ) throws Exception {
        sendMsgFacadeService.sendMsg(paramDto);
        BaseResultDto resultDto = new BaseResultDto();
        resultDto.setResultCode(0);
        return resultDto;
    }
}
